<?php

namespace app\common\model;

use think\Model;

class Tag extends Model {
    protected $pk    = 'tag_id';
    protected $table = 'blog_tag';


    public function store($data) {
        $ret = $this->validate(true)->save($data, $data[$this->pk]);
        if ($ret) {
            return ['valid' => 1, 'msg' => '操作成功'];
        } else {
            return ['valid' => 0, 'msg' => $this->getError()];
        }
    }

}
